简书链接:原创vscode神速快捷键分享以及修改教程
文章字数:526,阅读全文大约需要2分钟

文件首选项-键快捷方式-keybindings.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

```alt+w```移动当前行到上面一行

```alt+s ```相反

```ctrl+shift+f```格式化

```alt+u ```光标移动到行首

```alt+o ```光标移动到行尾

```ctrl+J```跳转到指定行

```shift+s```在当前行下面插入一行

```shift+w```在当前行上面插入一行

```alt+n```复制当前行到下面一行

这是我常用的快捷键了还可以用alt+s保存文件。


```ctrl+shift+o```列出当前 页面的方法定义

```shift+f12```列出选择的方法在本项目所有的引用。

```shift+alt+r```修改方法名 变量名 等 默认快捷键是f2

```ctrl+w``` 关闭当前文件



今天倒腾vscode,发现快捷键和之前的白鹭引擎一样,感情之前白鹭引擎能开发小程序实际上就是基于vscode开源代码修改的。。哈哈,果然牛逼,这东西是跨平台的,我认为是目前最好的轻量级可扩展的工具了,俄罗斯的全家桶都是渣渣,哈哈

这是我见过的最方便自定义快捷键的神器了,赶紧翻出来之前有道云的笔记,直接粘贴应该就能用了。

![image.png](https://upload-images.jianshu.io/upload_images/2815884-131a65205bbefb25.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/800)



![image.png](https://upload-images.jianshu.io/upload_images/2815884-620e6fe9a7b679cb.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/800)

如上面右边默认是空白的,直接把下面的东西粘贴下去就ok.

// 使用当前快捷键设置覆盖默认设置
[
{
“key”: “alt+d”,
“command”: “editor.action.deleteLines”,
“when”: “editorFocus”
},
{
“key”: “alt+w”,
“command”: “editor.action.moveLinesUpAction”,
“when”: “editorTextFocus”
},
{
“key”: “alt+s”,
“command”: “editor.action.moveLinesDownAction”,
“when”: “editorTextFocus”
},
{
“key”: “ctrl+shift+f”,
“command”: “editor.action.format”,
“when”: “editorTextFocus”
},
{
“key”: “f7”,
“command”: “workbench.action.debug.stepOut”,
“when”: “inDebugMode”
},
{
“key”: “alt+u”,
“command”: “cursorHome”,
“when”: “editorTextFocus”
},
{
“key”: “alt+o”,
“command”: “cursorEnd”,
“when”: “editorTextFocus”
},
{
“key”: “ctrl+j”,
“command”: “workbench.action.gotoLine”
},
{
“key”: “f6”,
“command”: “workbench.action.debug.stepOver”,
“when”: “inDebugMode”
},
{
“key”: “shift+s”,
“command”: “editor.action.insertLineAfter”,
“when”: “editorTextFocus”
},
{
“key”: “shift+w”,
“command”: “editor.action.insertLineBefore”,
“when”: “editorTextFocus”
},
{
“key”: “alt+n”,
“command”: “editor.action.copyLinesDownAction”,
“when”: “editorTextFocus”
},
{
“key”: “f5”,
“command”: “workbench.action.debug.stepInto”,
“when”: “inDebugMode”
},
{
“key”: “shift+alt+r”,
“command”: “editor.action.rename”,
“when”: “editorTextFocus”
},
{
“key”: “alt+i”,
“command”: “cursorUp”,
“when”: “textInputFocus”
},
{
“key”: “alt+k”,
“command”: “cursorDown”,
“when”: “textInputFocus”
},
{
“key”: “alt+j”,
“command”: “cursorLeft”,
“when”: “textInputFocus”
},
{
“key”: “alt+l”,
“command”: “cursorRight”,
“when”: “textInputFocus”
},
]

1
2
3

2021-12-18 12:22:30
支持alt+/

// 使用当前快捷键设置覆盖默认设置
[
{
“key”: “alt+d”,
“command”: “editor.action.deleteLines”,
“when”: “editorFocus”
},
{
“key”: “alt+w”,
“command”: “editor.action.moveLinesUpAction”,
“when”: “editorTextFocus”
},
{
“key”: “alt+s”,
“command”: “editor.action.moveLinesDownAction”,
“when”: “editorTextFocus”
},
{
“key”: “ctrl+shift+f”,
“command”: “editor.action.format”,
“when”: “editorTextFocus”
},
{
“key”: “f7”,
“command”: “workbench.action.debug.stepOut”,
“when”: “inDebugMode”
},
{
“key”: “alt+u”,
“command”: “cursorHome”,
“when”: “editorTextFocus”
},
{
“key”: “alt+o”,
“command”: “cursorEnd”,
“when”: “editorTextFocus”
},
{
“key”: “ctrl+j”,
“command”: “workbench.action.gotoLine”
},
{
“key”: “f6”,
“command”: “workbench.action.debug.stepOver”,
“when”: “inDebugMode”
},
{
“key”: “shift+s”,
“command”: “editor.action.insertLineAfter”,
“when”: “editorTextFocus”
},
{
“key”: “shift+w”,
“command”: “editor.action.insertLineBefore”,
“when”: “editorTextFocus”
},
{
“key”: “alt+n”,
“command”: “editor.action.copyLinesDownAction”,
“when”: “editorTextFocus”
},
{
“key”: “f5”,
“command”: “workbench.action.debug.stepInto”,
“when”: “inDebugMode”
},
{
“key”: “shift+alt+r”,
“command”: “editor.action.rename”,
“when”: “editorTextFocus”
},
{
“key”: “alt+i”,
“command”: “cursorUp”,
“when”: “textInputFocus”
},
{
“key”: “alt+k”,
“command”: “cursorDown”,
“when”: “textInputFocus”
},
{
“key”: “alt+j”,
“command”: “cursorLeft”,
“when”: “textInputFocus”
},
{
“key”: “alt+l”,
“command”: “cursorRight”,
“when”: “textInputFocus”
},
{
“key”: “alt+oem_2”,
“command”: “notebook.cell.insertCodeCellBelow”,
“when”: “notebookCellListFocused && !inputFocus”
},
{
“key”: “ctrl+enter”,
“command”: “-notebook.cell.insertCodeCellBelow”,
“when”: “notebookCellListFocused && !inputFocus”
},
{
“key”: “alt+oem_2”,
“command”: “editor.action.triggerSuggest”,
“when”: “editorHasCompletionItemProvider && textInputFocus && !editorReadonly”
},
{
“key”: “ctrl+space”,
“command”: “-editor.action.triggerSuggest”,
“when”: “editorHasCompletionItemProvider && textInputFocus && !editorReadonly”
},
]




如果修改配置无效,点击下面所示的图标然后输入```@recommended:keymaps ```
列出已安装的扩展,如图所示禁用visual studio keymap 就可以解决问题啦
![ba](https://upload-images.jianshu.io/upload_images/2815884-08caa52d16bdeca7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)